package dk.hewison.client.panels;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.LoadListener;
import org.adamtacy.client.ui.effects.impl.Fade;

/**
 * @author John Hewison
 * @author $LastChangedBy: john.hewison $:  $ $LastChangedDate: 2009-02-01 11:50:46 +0000 (Sun, 01 Feb 2009) $:
 * @version $Revision: 82 $:
 */
public class ThumbnailPanel extends Composite {
    Image image;
    private Fade fadeIn;

    //NEffectPanel effectPanel;
    //NEffectPanel effectPanel;

    public ThumbnailPanel(String imageName, LoadListener loadListener) {

        image = new Image(imageName);

        if (loadListener != null) {
            image.addLoadListener(loadListener);
        }

        /*image.addLoadListener(new LoadListener() {
            public void onError(Widget sender) {

            }

            public void onLoad(Widget sender) {
                //effectPanel.playEffects();
            }
        });*/

        //init();


        initWidget(image);
    }

    /*private void init() {
        initEffect();
        effectPanel = new NEffectPanel();
        effectPanel.addEffect(fadeIn);
        effectPanel.add(image);


        //effectPanel.setEffectsLength(0.3);
    }

    public void show() {
        effectPanel.playEffects();
    }


    public void initEffect() {
        fadeIn = new MyFade();
        fadeIn.getProperties().setStartValue("0");
        fadeIn.getProperties().setEndValue("100");
    }


    class MyFade extends Fade {
        MyFade() {
            effectLengthSeconds = 0.3;
        }
    }*/
}